<?php
/**
 * Created by PhpStorm.
 * User: hang
 * Date: 2021/12/6
 * Time: 13:19
 */
$username = $_POST['username'];
$password = $_POST['pwd'];
if ($username == 'admin' && $password == 888888){
    echo '登入成功！<br/>';
    setcookie('Token',md5($username.$password.time()),time()+3600*24);
    echo '<a href="userAction.php">用户中心<br/></a>';
    if (!empty($_COOKIE['Token'])){
        echo 'cookie 存在';
    }else{
        echo 'cookie 不存在';
    }
}else{
    echo '用户名或密码错误！';
}